As shown in FIG. 23, for example, a servo motor control apparatus comprising a positional feedback loop is generally provided with a speed feedback loop for controlling a speed of revolution of motor 10 and a current feedback loop for controlling a current of motor 10, in addition to a positional feedback loop for controlling position of revolution of motor 10 or position of a mechanical movable part (not shown). In the current feedback loop, control is carried out so that deviation .DELTA.I between a motor current I.sub.d detected by a resistor 11 and a current command value I.sub.s sent from a proportional integral controller 12 becomes zero, while in the speed feedback loop, deviation (Ve) between a motor speed v.sub.d detected by speed detector such as a tachometer and a speed command value V.sub.s sent from D/A converter 14 becomes zero. Finally, the position of motor is controlled by a positional feedback loop so that difference between position of motor e.sub.d detected by position detector 15 such as a resolver or linearscale, etc. and a position command value e.sub.s given from a command pulse generating circuit 16 becomes zero. In FIG. 23, 17 is amplifier; 18a-18c are adders.
FIG. 24 is an electrical circuit which indicates a conventional structure including an adder 18b, a proportional integral controller 12 and an adder 18c shown in FIG. 23. An operational amplifier Q.sub.1, resistors R.sub.1 -R.sub.4 and a capacitor C.sub.1 form an adder 18b and a proportional integral controller 12, while an operational amplifier Q.sub.2 and resistors R.sub.5 -R.sub.8 form an adder 18c.
The relationship between motor current I.sub.d, a motor speed command V.sub.s and motor speed V.sub.d in a conventional servo motor control apparatus having the structure shown in FIG. 23, when the rotating direction of motor is reversed, can be indicated, for example, as the curves 30v.sub.r, 31v and 32i of FIG. 25, where motor current I.sub.d, motor speed command V.sub.s and motor speed V.sub.d are plotted on the vertical axis and the time t on the horizontal axis with the direction inversion command input time located at the origin. Here, I.sub.o is a value of friction torque of the machine converted in terms of a motor current. In this figure, a speed command is reduced with a constant deceleration from the positive to negative direction. As will be understood from this figure, when a speed command is input in the opposite direction when t=0, a motor current I.sub.d indicated by a curve 32i gradually reduces but a motor speed V.sub.d indicated by a curve 31v is zero until the motor current I.sub.d exceeds -I.sub.o and the motor starts to rotate when a motor current I.sub.d exceeds -I.sub.o. Namely, a time lag T.sub.1 is generated during the period from input of speed command in the opposite direction until start of motor in the reverse direction.
Such time lag naturally appears as a working error in numerical control. More specific, as shown in FIG. 26, the cutting should be done along a true circle shown by a curve 40 through distribution of command pulses of a true circle but actually such discrepancy occurs that the actual shape of work to be cut shows extruded portions as shown by the curve 41 at the quadrant exchange regions of circular cutting due to the delay of response generated when the rotating direction is inversed.
This phenomenon is further explained below. In FIG. 26, in the section I, only the X axis changes and Y axis does not change and the maximum speed is obtained. In the section II, the Y axis also changes but a true circle is not obtained. In the section III, both X and Y axes change and a true circle can be obtained. When the Y axis changes in the one direction from the stationary condition, such timing is delayed and thereby said sections I, II can be generated and extruded portions can be formed when the machining error from a true circle is considered.
In current numerical control, the pulse distibution of straight line and circle is used and therefore a problem rises in circular cutting. In addition to circular cutting, the same problem also occurs in such a locus where direction of speed command of another shaft is reversed while the sign of the speed command of a shaft is constant, namely a temporary stop occurs, for example, in the contour control of parabolic locus.
As a method for improving such discrepancy, a method disclosed in the Japanese Patent Provisional Publication No. 57-71282 has been proposed.
This method is intended to enhance control accuracy through compensation for response lag of motor caused by a friction torque when the motor changes the rotating direction. Considering that a voltage determining a current command value when the direction inversion signal is input is proportional to a friction torque, a compensating voltage which is almost equal to such voltage in the absolute value and has polarity opposed to it is generated and this compensating voltage quickly presets, immediately after the direction inversion signal is input, a voltage forming said command current value to a voltage corresponding to a frictional torque.
This method will then be explained concretely. FIG. 27 shows an electrical circuit based on such improvement and the like symbols indicate the like elements in FIG. 24 and FIG. 27. In FIG. 27, 50 is a compensating voltage generating circuit; 51 is response compensating circuit; IN.sub.2 is an input terminal to which peak value set signal S.sub.1 is applied; IN.sub.3 is an input terminal to which a friction torque compensating signal S.sub.2 is an applied; OUT is output terminal from which a current command value I.sub.s is applied to the adder 18c in FIG. 23; Q.sub.4 -Q.sub.6 are operational amplifiers of the polarities shown in the figure; SW.sub.1, SW.sub.2 are switching elements; R.sub.10 - R.sub.18 are resistors; C.sub.2 is a capacitor. Moreover, -V.sub.s is an output obtained when V.sub.s is applied to an inverting amplifier of -1.
This circuit is different from a conventional apparatus shown in FIG. 24 in that the compensating voltage generating circuit 50 and the response compensating circuit 51 are provided.
The compensating voltage generating circuit 50 detects when a motor rotating direction inversion signal is output from a command pulse generating circuit 16 in the numerical control apparatus, a voltage which determines a current command value at this time, namely an output voltage (hereinafter referred to as a command voltage) of a proportional integral controller 12 and generates a compensating voltage V.sub.c which is almost equal to such command voltage in the absolute value and has the polarity opposed to it. This circuit is composed of an integral circuit consisting of a resistor R.sub.14 and a capacitor C.sub.2, a switching element SW.sub.1 which controls operation of such integral circuit and a polarity inversion circuit consisting of the operational amplifiers Q.sub.4, Q.sub.5 and resistors R.sub.13 R.sub.15, R.sub.17.
Moreover, the response compensating circuit 51 operates so that a command voltage is quickly set almost equal to a compensating voltage immediately after the motor rotating direction inversion command signal is input, and is composed of an operational amplifier Q.sub.6 which amplifies difference between command voltage and compensating voltage V.sub.c and a switching element SW.sub.2 which feeds back .DELTA.V which is an output of such amplifier to the input side of proportional integral controller 12.
FIG. 28 shows a diagram illustrating signal waveforms at respective points when the apparatus of FIG. 27 operates. With reference to the same figure, opertions of the apparatus of FIG. 27 are explained in detail.
When a direction inversion signal like FIG. 28(a) is output, for example, from a command pulse generating circuit 23, a peak value set signal S.sub.1 in duration T.sub.2, of which rising edge almost matches the rising part of direction inversion signal shown as FIG. 28(b), is generated by a control circuit (not shown).
This peak value set signal S.sub.1 is applied to the switching element SW.sub.1 of the compensating voltage generating circuit 50, turning ON this switching element SW.sub.1 only during the time T.sub.2. As a result, a capacitor C.sub.2 is charged by a command voltage at that time and a compensating voltage V.sub.c which is almost equal to the command voltage in the absolute value and is opposed thereto in the polarity appears at the output of operational amplifier Q.sub.5 with the time constant almost equal to t=C.sub.2 .times.R.sub.14. In case the time width (duration) T.sub.2 of peak value set signal S.sub.1 is set to about 2t 3t, a compensating voltage which is almost equal to the command voltage in the absolute value and is opposed thereto in the polarity can be obtained, for example, as shown in FIG. 28(c) from the compensating voltage generating circuit 50 and this compensating voltage is also held even after the switching element SW.sub.1 turns OFF.
Next, a frictional torque compensating signal S.sub.2 having duration T.sub.3 which rises in synchronization with fall of the peak value set signal S.sub.1 as shown in FIG. 28 (d) is generated by a control circuit not shown and it is applied to the switching element SW.sub.2 of response compensating circuit 51, turning it on. As a result, the command voltage is controlled to feedback to become almost equal to the compensating voltage V.sub.c with the output of the operational amplifier Q.sub.6 which amplifies a difference between the command voltage and compensating voltage V.sub.c and thereby the command voltage immediately falls as shown in FIG. 28(e) (however, rises immediately in the case of opposed direction inversion). Here, compensation speed of the command voltage can be freely changed by adjusting the value of resistor R.sub.12.
As explained above, according to the method proposed by said prior art, a motor current I.sub.d exceeds the opposite friction torque I.sub.o quicker than the conventional circuit with operation of the compensating function and the motor speed also rises quicker as much and thereby the time lag due to inversion of rotating direction of motor can be improved remarkably. In addition, time lag due to the inversion of rotating direction can be changed freely by adjusting a value of resistor R.sub.12.
As explained above, the apparatus disclosed in the Japanese Patent Provisional Publication No. 57-71282 is certainly capable of improving a time lag of a servo system due to a frictional torque for the conventional servo motor control apparatus but also provides following disadvantages.
(1) A frictional torque cannot be compensated during the time T.sub.2 for setting a peak value to the compensating voltage generating circuit 50 and time lag of the servo system due to frictional torque cannot be improved.
(2) During the period between time T.sub.2 and T.sub.2 +T.sub.3 shown in FIG. 28, an output .DELTA.V of an operational amplifier Q.sub.6 of FIG. 27 becomes equal, while the speed command value changes to positive from negative, to a negative saturation voltage -V.sub.sat (or a positive saturation voltage +V.sub.sat in case the speed command changes to negative from positive). The time of direction inversion is considered as t=0 and the successive output waveforms of operational amplifiers Q.sub.2, Q.sub.6 are shown in FIG. 29. Since T.sub.2, T.sub.3 are actually selected to be very short periods, it is possible to approximately assume that V.sub.s =0, V.sub.d =0 respectively until the time near t=T.sub.2 +T.sub.3 from t=0. When t=T.sub.2, SW.sub.2 closes and a saturation voltage +V.sub.sat is applied to Q.sub.2, since Q.sub.2 is a proportional integral controller, I.sub.2 changes like a step as much as I.sub.p due to the operation of proportional controller at t=T.sub.2 and thereafter I.sub.s changes at a constant gradient determined by -V.sub.sat and integral time constant due to the opertion of integral controller. At the moment when I.sub.s =-I.sub.o, namely when t=T.sub.2 +T.sub.3, SW.sub.2 is open and an input of Q.sub.2 becomes zero. At this time, however, since a curent command value I.sub.p due to the operation of proportional controller momentarily disappears, I.sub.s immediately after t=T.sub.2 +T.sub.3 becomes equal to -I.sub.o +I.sub.p but does not become equal to -I.sub.o.
Namely, when friction during transfer to the positive (negative) direction at a certain position is I.sub.o (in terms of a motor current), friction during transfer in the opposite direction at the area very near to such position can be assumed as -I.sub.o. Therefore, it is ideal for compensation of friction when the rotating direction is inversed to change momentarily the current command value from I.sub.o to -I.sub.o. However, in the method of Japanese Patent Provisional Publication No. 57-71282, I.sub.s changes to -I.sub.o +I.sub.p and compensation of frictional torque becomes insufficient as much as I.sub.p.
Accordingly, the method of Japanese Patent Provisional Publication No. 57-71282 cannot perfectly compensate for the frictional torque. Imperfect integral can also be attempted by inserting in parallel a resistor with a capacitor C.sub.1 in FIG. 27, but since such resistance value is actually selected to be a considerably large value, such content is also established in this case. Meanwhile, a small value cannot bring about an excellent characteristic for the control of speed system itself.
(3) Said patent does not refer to a logic circuit for switching SW.sub.2. The closing timing is obvious as t=T.sub.2 but the opening timing must be set to the timing where an output (.DELTA.V) of Q.sub.6 changes. However, since an output of Q.sub.6 changes to +V.sub.sat from -V.sub.sat or to -V.sub.sat from +V.sub.sat depending on positive or negative voltage being held by Q.sub.4, some logic circuits are necessary for seizing the timing of such change.
(4) Although it may be repetition of items (1) and (2), the method of said patent 57-71282 requires the time, total of T.sub.2 +T.sub.3 (T.sub.2 : required until I.sub.o is set to the compensating voltage circuit; T.sub.3 : required until the response compensating circuit operates and a current command value I.sub.s becomes equal to I.sub.o, which is actually a little longer than T.sub.3 as explained in item (2)), until the frictional torque is compensated.
Moreover, the relationship among a motor current I.sub.d at the initial condition, motor speed command V.sub.s and motor speed V.sub.d in the conventional servo motor control apparatus having the structure shown in FIG. 23 can be indicated, for example, as FIG. 33 (a),(b) depending on the preceding positive or negative rotations before stoppage, where motor current I.sub.d, motor speed command V.sub.s and motor speed V.sub.d are plotted on the vertical axis, while time t on the horizontal axis with the direction inversion command input time located at the origin. The curves 30v.sub.r, 31v.sub.d, 32i.sub.d indicated by (a1), (b1), (a2), (b2), (a3), (b3) respectively represent motor speed command, motor speed and motor current. However, a servo motor is assumed as to rotate in accordance with a current command I.sub.s and I.sub.s is omitted. I.sub.o is a frictional torque of machine and a torque corresponding to the external works; I.sub.1 is static frictional torque of machine; I.sub.2 is a frictional torque where a torque corresponding to external work and acceleration torque are respectively converted in terms of a motor current. In the case of example shown in the figure, a motor rotation command output starts in the positive direction. FIG. 33(a) indicates the case where rotation before stoppage is negative, while FIG. 33 (b) the case where rotation before stoppage is positive.
Next, FIG. 25 is an example where the motor rotating direction is inversed in case the acceleration and deceleration torques can be disregarded. Each symbol is the same as that in FIG. 33 and a speed command is reduced at a constant acceleration to negative from positive direction.
As is understood from FIG. 33, when a speed command is input at t=0, a motor current I.sub.d indicated by a curve 32i.sub.d increases gradually and a motor speed vd indicated by the curve 31v.sub.d is zero but vibrates until said motor current reaches I.sub.0. When it reaches I.sub.o, the motor speed v.sub.d starts rotation depending on the speed command v.sub.s. Namely, even when the servo system shown in FIG. 23 is stable, the motor vibrates at the time of starting rotation and some time lag is generated until the motor starts rotation.
Such time lag and vibration are naturally appearing as the machining error in numerical control. More specific, the following discrepancy is generated, namely, since cutting is started, for example, after eliminating the vibration shown in FIG. 34, dwelling of a constant time is required, or as shown in FIG. 26, cutting should be done along a true circle shown in FIG. 40 through distibution of command pulse trains of true circle but the shape of actual work has extruded portions as shown by a curve 41 at the quadrant changing portion of circular cutting because of a response lag when the rotating direction is inversed. A straight line e.sub.s in FIG. 34 indicates a position command, while a curve e.sub.d indicates a position of actual motor or movable part of machine.
The present invention is intended to solve the problems of a conventional control circuit shown in FIG. 24 explained above and the method proposed in the Japanese Patent Provisional Publication No. 57-71282 shown in FIG. 27. It is the primary object of the present invention to enhance control accuracy by compensating for response lag of the motor caused by a frictional torque when the motor rotating direction is reversed. It is the second object of the present invention to apply a motor control conforming to the primary object to a digital speed loop. Moreover, it is the third object of the present invention to enhance control accuracy by reducing response lag of the motor caused by frictional torque when the motor rotating direction is reversed. It is the fourth object of the present invention to enhance control accuracy by compensating for vibration and response lag of the motor caused by a frictional torque, etc. when the motor starts to rotate or motor rotating direction is reversed. Moreover, it is the fifth object of the present invention to apply the motor control conforming to said fourth object to the digital speed loop.